package org.cuatrovientos.erp.model;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * Da class for the stock
 * @author Enrico Baroni
 *
 */
public class Stock {
	
	private int id;
	
	@Size(min=1,message="{stock.rack.error}")
	private int rack;
		
	@NotNull(message="{stock.description.error}")
	private String description;
	
	@Size(min=1,message="{stock.rack.error}")
	private int qty;
	
	@Size(min=1,message="{stock.idproduct.error}")	
	private int idproduct;
	
	public Stock () {
		
	}

	
	/**
	 * @param id
	 * @param rack
	 * @param description
	 * @param qty
	 * @param idproduct
	 */
	public Stock(int id, int rack, String description,
			int qty, int idproduct) {
		this.id = id;
		this.rack = rack;
		this.description = description;
		this.qty = qty;
		this.idproduct = idproduct;
	}

	

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}


	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}


	/**
	 * @return the rack
	 */
	public int getRack() {
		return rack;
	}


	/**
	 * @param rack the rack to set
	 */
	public void setRack(int rack) {
		this.rack = rack;
	}


	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}


	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}


	/**
	 * @return the qty
	 */
	public int getQty() {
		return qty;
	}


	/**
	 * @param qty the qty to set
	 */
	public void setQty(int qty) {
		this.qty = qty;
	}


	/**
	 * @return the idproduct
	 */
	public int getIdproduct() {
		return idproduct;
	}


	/**
	 * @param idproduct the idproduct to set
	 */
	public void setIdproduct(int idproduct) {
		this.idproduct = idproduct;
	}


	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "User [id=" + id + ", rack=" + rack
				+ ", description=" + description + ", qty=" + qty
				+ ", idproduct=" + idproduct + "]";
	}
}
